const Router = require('koa-router');
const searchController = require('../controller/auth/userList');
const accessController = require('../controller/auth/accessList');
const updateUserController = require('../controller/auth/updateUserMessage');

// 路由前缀
const router = new Router({
    prefix: '/api'
});

module.exports = (app) => {
    // 查询所有用户
    router.get('/userList', searchController.userList);
    router.get('/accessList', accessController.accessList);
    router.post('/updateUser', updateUserController.updateUser);

    app
        .use(router.routes())
        .use(router.allowedMethods())
};
